Alias /ostree/ ${test_tmpdir}/ostree-srv/
# ScriptAlias /ostree/ ${test_tmpdir}/httpd/ostree-http-backend/
EOF
- ${SRCDIR}/tmpdir-lifecycle ${SRCDIR}/run-apache `pwd`/httpd.conf ${test_tmpdir}/httpd-address
+ ${SRCDIR}/tmpdir-lifecycle ${SRCDIR}/run-apache `pwd`/httpd.conf ${test_tmpdir}/httpd-address &
+ for i in $(seq 5); do
+ if ! test -f ${test_tmpdir}/httpd-address; then
+ sleep 1
+ else
+ break
+ fi
+ done
+ if ! test -f ${test_tmpdir}/httpd-address; then
+ echo "Error: timed out waiting for httpd-address file"
+ exit 1
+ fi
cd ${oldpwd}
}
httpd_argv = g_ptr_array_new ();
g_ptr_array_add (httpd_argv, "httpd");
+ g_ptr_array_add (httpd_argv, "-X");
g_ptr_array_add (httpd_argv, "-f");
g_ptr_array_add (httpd_argv, argv[1]);
g_ptr_array_add (httpd_argv, "-C");
GError *error = NULL;
GPtrArray *new_argv;
int i;
- GPid pid;
struct TmpdirLifecyleData data;
g_type_init ();
g_ptr_array_add (new_argv, NULL);
if (!g_spawn_async (NULL, (char**)new_argv->pdata, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
- NULL, NULL, &pid, &error))
+ NULL, NULL, &data.pid, &error))
{
g_printerr ("%s\n", error->message);
return 1;
}
- g_child_watch_add (pid, on_child_exited, &data);
+ g_child_watch_add (data.pid, on_child_exited, &data);
g_main_loop_run (data.loop);